package rate;

import com.google.common.util.concurrent.RateLimiter;

import java.util.Date;

/**
 * @author Created by chenxin34 on 2020/2/28 下午5:10.
 */
public class RateLimitTest {
    public static void main(String[] args) {
        RateLimiter rateLimiter = RateLimiter.create(1000);
        System.out.println(new Date());
        System.out.println("1111");
        rateLimiter.acquire(10000);
        System.out.println(new Date());
        System.out.println("22222");
        rateLimiter.acquire(10000);
        System.out.println(new Date());
        System.out.println("3333");
    }
}
